//
// api.js
// vue3-element-admin
//
// Created by 区区电脑 on 2023/04/10.
//
import request from "@/request";


/**
 * 切换用户当前组织信息
 * @param data
 * @returns {Promise | Promise<unknown> | *}
 * @constructor
 */
export function UpdateUserCurrentOrgInfo(data) {
    return request({url: "/api/SysUser/UpdateUserCurrentOrgInfo", method: "put", data})
}

// 登录
export function Login(data) {
    return request({ url: `/api/Login/Login`, method: "post", data });
}

// 获取用户详情
export function GetCurrentUserInfo(data) {
    return request({ url: `/api/Login/GetCurrentUserEntity`, method: "get", data });
}

/**
 * 获取菜单树
 * @param params
 * @returns {Promise<unknown> | *}
 * @constructor
 */
export function GetMenuTreeList(params = {}) {
    return request({url: `/api/SysMenu/GetMenuTreeList`, method: 'get', params})
}

/**
 * 批量新增菜单
 * @param data
 * @returns {Promise<unknown> | *}
 * @constructor
 */
export function AddMenuList(data = []) {
    return request({url: `/api/SysMenu/AddMenuList`, method: "post", data})
}